package com.sq.News.dao;

import java.util.ArrayList;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.sq.News.pojo.UserInfo;

@Repository("UserMapper")
@Mapper
public interface UserMapper {
	String TABLE_NAME = "user";
	String INSERT_FIELDS = "dept_name, dept_leader";

	@Select({ "SELECT * from", TABLE_NAME })
	ArrayList<UserInfo> getUsers();

	@Select({ "SELECT * from", TABLE_NAME, "where name=#{name}" })
	UserInfo getUser(@Param(value = "name") String name);

	boolean addUser(String name, String password);

}
